﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iLangl.Model;
using System.Data;
using iLangl.LanguageWire.DAL.iLanglDAL;
using iLangl.LanguageWire.LWIntegration;
using iLangl.LanguageWire.DAL.LanguageWireDAL;

namespace iLangl.LanguageWire.Managers
{
	public class CompanyManager
	{
		#region Singelton Pattern
		private CompanyManager()
		{
		}

		private static CompanyManager instance;
		private static object mutex = new object();
		/// <summary>
		/// The instance of the CompanyManager.
		/// </summary>
		public static CompanyManager Instance
		{
			get
			{
				if (instance == null)
				{
					lock (mutex)
					{
						if (instance == null)
						{
							instance = new CompanyManager();
						}
					}
				}
				return instance;
			}
		}
		#endregion


		public void CreateCompany(Company company)
		{
			DALFacadeLW.Instance.CompanyDAL.CreateCompany(company);
		}

		public Company GetLWCompanyInfo()
		{
			return DALFacadeLW.Instance.CompanyDAL.GetLWCompanyInfo();
		}

		public void UpdateCompany(Company company)
		{
			DALFacade.Instance.CompanyDAL.UpdateCompany(company, null);
		}
	}
}
